/**
 * Created by yiwei on 2017/09/28.
 * 
 */
import { actionGlobal } from "../actions";
export function globalReducer(state = {
    loading: {
        show: false,
        tip: ''
    },
}, action) {
    switch (action.type) {
        case actionGlobal.SHOW_LOADING:
            return {
                ...state,
                loading: {
                    show: true,
                    tip: action.payload
                }
            }
        case actionGlobal.HIDE_LOADING:
            return {
                ...state,
                loading: {
                    show: false,
                    tip: ''
                }
            }
        default:
            return state;
    }
}